export default {
	data() {
		return {
			statusBarHeight: 0, //距离顶部距离
			navigationBarHeight: 0
		}
	},
	mounted() {
		this.getTopIconDistance()
	},
	onPageScroll(e) {
		console.log(e)
	},
	methods: {
		// 判断对象为空
		 isObjEmpty(obj) {
			return Object.getOwnPropertyNames(obj).length === 0;
		},
		// 获取顶部距离
		getTopIconDistance() {
			// 获取系统信息
			uni.getSystemInfo({
				success: (res) => {

					const menuButtonInfo = uni.getMenuButtonBoundingClientRect();

					// 导航区域高度 = 状态栏的高度 + 导航栏内嵌高度（如果有）
					let statusBarHeight = res.statusBarHeight + (res.navigationBarHeight ? res
						.navigationBarHeight : 0);

					let navigationBarHeight = statusBarHeight + menuButtonInfo.height + (menuButtonInfo
						.top - statusBarHeight)

					this.navigationBarHeight = navigationBarHeight
					this.statusBarHeight = statusBarHeight
				}
			});
		}
	},
}